package ai.people.netmon.framework.domain.gang.construction.entity;

import ai.people.netmon.framework.domain.gang.construction.request.LabelLibSampleExcel;
import ai.people.netmon.framework.domain.gang.construction.request.LabelLibSampleSaveOrUpdateRequest;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author zhenglin
 * @since 2022-07-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(schema = "webservice")
@NoArgsConstructor
public class LabelLibSample implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long id;

    /**
     * 标签ID
     */
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long labelLibId;

    /**
     * 样本
     */
    private String sample;

    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 推荐id
     */
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long recommendId;


    public LabelLibSample(LabelLibSampleSaveOrUpdateRequest request) {
        this.labelLibId = request.getLabelLibId();
        this.sample = request.getSample();
    }

    public LabelLibSample(LabelLibSampleRecommend data, Long labelLibId) {
        this.labelLibId = labelLibId;
        this.sample = data.getSample();
    }

    public LabelLibSample(LabelLibSampleExcel excel, Long labelLibId) {
        this.labelLibId = labelLibId;
        this.sample = excel.getSample();
    }
}
